<?php /* Smarty version Smarty-3.1.18, created on 2015-08-22 11:25:43
         compiled from "E:\www\gfour\Admin\View\Vote\info.html" */ ?>
<?php /*%%SmartyHeaderCode:3072755ce218bcf0068-37406970%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '84f44c8da4016845f267e2829b75a852b691f437' => 
    array (
      0 => 'E:\\www\\gfour\\Admin\\View\\Vote\\info.html',
      1 => 1440213940,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '3072755ce218bcf0068-37406970',
  'function' => 
  array (
  ),
  'version' => 'Smarty-3.1.18',
  'unifunc' => 'content_55ce218bd9fd12_68920672',
  'variables' => 
  array (
    '_C' => 0,
    'vote' => 0,
    'option' => 0,
    '_L' => 0,
  ),
  'has_nocache_code' => false,
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_55ce218bd9fd12_68920672')) {function content_55ce218bd9fd12_68920672($_smarty_tpl) {?><!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="<?php echo $_smarty_tpl->tpl_vars['_C']->value['hy_path'];?>
css/amazeui.min.css" />
		<link rel="stylesheet" type="text/css" href="<?php echo $_smarty_tpl->tpl_vars['_C']->value['hy_path'];?>
css/hy.admin.css" />
		<style>
			
			.option>div
			{
				margin-bottom:5px;
			}
		</style>
	</head>

	<body>
		<div class="am-g">
		<?php echo $_smarty_tpl->getSubTemplate ('../Common/hy_header.html', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>

			<div class="am-u-md-8 am-u-end">
				<form class="am-form am-form-horizontal hy-js-form">
					<div class="am-form-group">
						<label for="user-name" class="am-u-sm-3 am-form-label">标题</label>
						<div class="am-u-sm-9">
							<input type="text" name="name" value="<?php echo $_smarty_tpl->tpl_vars['vote']->value['name'];?>
" placeholder=""  <?php if ($_smarty_tpl->tpl_vars['vote']->value['joinnums']>0) {?> readonly=true <?php }?> >
						</div>
					</div>
					<div class="am-form-group">
						<label for="user-name" class="am-u-sm-3 am-form-label">参与人数</label>
						<div class="am-u-sm-9">
							
							<input type="text" value="<?php echo (($tmp = @$_smarty_tpl->tpl_vars['vote']->value['joinnums'])===null||$tmp==='' ? 0 : $tmp);?>
" name="joinnums"  readonly=true >
						</div>
					</div>
					
					<div class="am-form-group">
						<label for="user-name" class="am-u-sm-3 am-form-label">活动时间:</label>
						<div class="am-u-sm-9">
							
								<div class="am-u-md-6 am-cf " style="padding-left:0px;">
						        
						          <div class="am-input-group am-input-group-sm" style="width:100%">
						          		<input name="dotime1"  value="<?php echo $_smarty_tpl->tpl_vars['vote']->value['dotime1'];?>
" data-am-datepicker type="text" class="am-form-field hy-js-search-type" placeholder="起始時間">
						          </div>
						        
						      </div>
							  <div class="am-u-md-6 am-cf " style="padding-left:0px;padding-right:0" >
						        
						          <div class="am-input-group am-input-group-sm"  style="width:100%">
						          		<input name="dotime2" value="<?php echo $_smarty_tpl->tpl_vars['vote']->value['dotime2'];?>
" data-am-datepicker type="text" class="am-form-field hy-js-search-type" placeholder="截止時間">
						          </div>
						        
						      </div>
	  					</div>
					</div>
					
					<div class="am-form-group">
						<label for="user-name" class="am-u-sm-3 am-form-label">选项:</label>
						<div class="am-u-sm-9">
							
							<?php if ($_smarty_tpl->tpl_vars['vote']->value['option']) {?>
							<?php  $_smarty_tpl->tpl_vars['option'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['option']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['vote']->value['option']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
 $_smarty_tpl->tpl_vars['smarty']->value['foreach']['option']['index']=-1;
foreach ($_from as $_smarty_tpl->tpl_vars['option']->key => $_smarty_tpl->tpl_vars['option']->value) {
$_smarty_tpl->tpl_vars['option']->_loop = true;
 $_smarty_tpl->tpl_vars['smarty']->value['foreach']['option']['index']++;
?>
							
							
							
							<div id="option<?php echo $_smarty_tpl->tpl_vars['option']->value['id'];?>
" class="option" >
							<div class="am-u-sm-8" style="padding-left:0px">
								<input type="text" value="<?php echo $_smarty_tpl->tpl_vars['option']->value['name'];?>
" name="option_name[]"  <?php if ($_smarty_tpl->tpl_vars['vote']->value['joinnums']>0) {?> disabled=true <?php }?>  >
							</div>
							
							<label  class="am-u-sm-2 am-form-label"><?php echo $_smarty_tpl->tpl_vars['option']->value['playnums'];?>
票</label>
							<?php if ($_smarty_tpl->tpl_vars['vote']->value['joinnums']==0) {?> 
							<?php if ($_smarty_tpl->getVariable('smarty')->value['foreach']['option']['index']==0) {?>
            				
							<div class="am-u-sm-2 " >
								<div class="am-btn-toolbar " style="display:inline-block;">
            <div class="am-btn-group am-btn-group-xs">
              <button  onclick="addInput()"  type="button" class="am-btn am-btn-default "><span class="am-icon-plus"></span> 添加</button>
            </div>

           
          </div>
		  

							</div>
							
							<?php } else { ?>
							
							<div class="am-u-sm-2 " >
								<div class="am-btn-toolbar " style="display:inline-block;">
            <div class="am-btn-group am-btn-group-xs">
              <button  onclick="delInput('option<?php echo $_smarty_tpl->tpl_vars['option']->value['id'];?>
')"  type="button" class="am-btn am-btn-default "><span class="am-icon-trash-o"></span> 删除</button>
            </div>

           
          </div>
		  

							</div>
						
						
							
							<?php }?>
							<?php }?>
							</div>
							<?php } ?>
							</div>
							<?php } else { ?>
							<div id="option0" class="option">
							<div class="am-u-sm-8" style="padding-left:0px">
								<input type="text" value="" name="option_name[]"  >
							</div>
							
								<label  class="am-u-sm-2 am-form-label">0票</label>
							
								<div class="am-u-sm-2 " >
								<div class="am-btn-toolbar " style="display:inline-block;">
            <div class="am-btn-group am-btn-group-xs">
              <button   onclick="addInput()"  type="button" class="am-btn am-btn-default"><span class="am-icon-plus"></span> 添加</button>
            </div>

           
          </div>
		  

							</div>

							</div>
							<?php }?>
						</div>
					
					
					<div class="am-form-group">
						<label for="user-name" class="am-u-sm-3 am-form-label">状态:</label>
					<div class="am-u-sm-9">
							<div class="am-btn-group" data-am-button="">
								<label class="am-btn am-btn-default am-btn-xs  <?php if ($_smarty_tpl->tpl_vars['vote']->value['status']==0) {?> am-active am-active <?php }?>">
									<input type="radio" name="status" value="0" <?php if ($_smarty_tpl->tpl_vars['vote']->value['status']!=1) {?> checked="checked" <?php }?> id="option1"> 结束
								</label>
								<label class="am-btn am-btn-default am-btn-xs  <?php if ($_smarty_tpl->tpl_vars['vote']->value['status']==1) {?> am-active am-active <?php }?>">
									<input type="radio" name="status" <?php if ($_smarty_tpl->tpl_vars['vote']->value['status']==1) {?> checked="checked" <?php } else { ?><?php }?> value="1" id="option2">开启
								</label>
							</div>
						</div>
					</div>	
						
					<div class="am-form-group">
						<div class="am-u-sm-9 am-u-sm-push-3">
							<input type="hidden" value="<?php echo $_smarty_tpl->tpl_vars['vote']->value['id'];?>
" name="id">
							<button type="button" class="am-btn am-btn-primary hy-js-submit"><?php echo $_smarty_tpl->tpl_vars['_L']->value['SAVE'];?>
</button>
						</div>
					</div>
				</form>
			</div>
		</div>
		<?php echo $_smarty_tpl->getSubTemplate ('../Common/hy_footer.html', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>

		<script type="text/javascript">
			 hy_submit('index.php?g=admin&m=vote&a=updateVote');
			 
			 
			 var num = 99999;
	
	function addInput()
		{
			
//			<div id="option0" class="option">
//							<div class="am-u-sm-8" style="padding-left:0px">
//								<input type="text" value="" name="option_name[]"  >
//							</div>
//							
//								<label  class="am-u-sm-2 am-form-label">0票</label>
//							
//								<div class="am-u-sm-2 " >
//								<div class="am-btn-toolbar " style="display:inline-block;">
//            <div class="am-btn-group am-btn-group-xs">
//              <button   onclick="addInput()"  type="button" class="am-btn am-btn-default"><span class="am-icon-plus"></span> 添加</button>
//            </div>
//
//           
//          </div>
//		  
//
//							</div>
//
//							</div>
			num++;
			
							var str='<div id="option'+num+'" class="option">'
								+'<div class="am-u-sm-8" style="padding-left:0px">'
								+'<input type="text" value="" name="option_name[]"  >'
								+'</div><label  class="am-u-sm-2 am-form-label">0票</label>'
								
								+'<div class="am-u-sm-2 " >'
								+'<div class="am-btn-toolbar " style="display:inline-block;">'
					            +'<div class="am-btn-group am-btn-group-xs">'
					            +'<button   onclick="delInput(\'option'+num+'\')"  type="button" class="am-btn am-btn-default"><span class="am-icon-trash-o"></span> 删除</button>'
					            +'</div>'
								+'</div>'
		  						+'</div>';
//								+'<span  style="line-height:35px;" onclick="delInput(\'option'+num+'\')">&nbsp;&nbsp;&nbsp;-'
//	            				+'</span>'
//								+'</div>'
//								+'</div>';
							
         	
			$(str).insertAfter(".option:last-child");
//			alert(str);
			
		}
		
		
		function delInput(id)
		{
			$("#"+id).html("").hide();
		}
		
		</script>
	</body>

</html><?php }} ?>
